package customer

import (
	"context"
	"github.com/go-sql-driver/mysql"
	"github.com/google/wire"
)

var CustomerSet = wire.NewSet(
	UserSet,
	InComeSet,
	BusinessTypeSet,
	InComeStatisticsSet,
	DailyRechargeSet,
	AnnouncementSet,
	RechargeSet,
	UserRecordsSet,
	UserAuthSet,
	SieveConfigSet,
	BusinessPriceSet,
) // end

// 判断是否是锁定错误
func isLockError(err error) bool {
	e, ok := err.(*mysql.MySQLError)
	if !ok {
		return false
	}

	return e.Number == 1205 || e.Number == 1213
}

// 判断是否是超时错误
func isDeadlineExceededError(err error) bool {

	if err == (context.DeadlineExceeded) {
		return true
	}

	return false
}
